package dou.utils;

import android.graphics.Rect;
import android.view.View;

/**
 * Created by mac on 2017/1/10 下午4:09.
 */

public class ViewUtil {
    public static Rect getRectInWindow(View view, boolean mIsFullWindow) {
        if (!mIsFullWindow) {
            Rect rect = new Rect();
            view.getGlobalVisibleRect(rect);
            return rect;
        }
        int[] location = new int[2];
        view.getLocationInWindow(location);
        return new Rect(location[0], location[1], location[0] + view.getMeasuredWidth(), location[1] + view.getMeasuredHeight());
    }
}
